﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfCommGoodsList.aspx.cs"
    Inherits="msBsc.WebUi.wfCommGoodsList" %>

<!DOCTYPE HTML>
<html>
<head id="Head1" runat="server"> 
    <title>商品列表</title>
    <link rel="shortcut icon" href="/themes/Style1/Image/favicon.ico"
        type="image/x-icon" />
    <link rel="stylesheet" href="/??themes/Style1/StyleQt.css,themes/Style1/Dealer.css" />
    <script src="/??jqPlugin/js/jquery-1.8.3.min.js,js/jBase.js,js/jBPage.js,themes/Style1/jsQt.js,themes/Style1/jsDealer.js"
        type="text/javascript"></script>
    <!--head fix rgn-->
    <style type="text/css">
        
    </style>
    <script type="text/javascript">
        $(window).load(function () {
            $.ploadFile("Grid", function (script, textStatus) {
                initGrid1();
            });
            $.ploadFile("layer", function (script, textStatus) {
                //                layer.load('加载中'); 
            });
        });
        function initGrid1() {
            var colsOption = [
            { id: 'chk', isCheckColumn: true, filterable: false, exportable: false },
            { id: 'GOODS_ID', hidden: true, filterable: false, exportable: false },
            { id: 'buynow', header: "操作", width: 50, filterable: false, exportable: false, sortable: false, printable: false,
                renderer: function (value, record, columnObj, grid, colNo, rowNo) {
                    return " <a target=\"_blank\"   href=\"/d_CommGoodsPublic.htm?ID=" + record.GOODS_ID + "\">修改</a>";
                }
            },
            { id: 'IMG_URL', header: "商品图片", width: 103, filterable: false, exportable: false, sortable: false, renderer: function (value, record, columnObj, grid, colNo, rowNo) {
                if (record.IMG_URL != "") {
                    return "<a target=\"_blank\" href=\"/c_GoodsView.htm?ID=" + record.GOODS_ID + "\"><img src='" + record.IMG_URL + "' style='width:100px;height:100px;' /></a>";
                }
            }
            },
            { id: 'GOODS_NME', header: "商品名称", width: 150, renderer: function (value, record, columnObj, grid, colNo, rowNo) {
                return " <a target=\"_blank\"  href=\"/c_GoodsView.htm?ID=" + record.GOODS_ID + "\">" + record.GOODS_NME + "</a>";
            } },
            { id: 'CT_LEVEL_DESC', header: "店铺导航分类", width: 135 },
            { id: 'GOODS_STRIKE_PRICE', header: "默认价格", width: 90 },
            { id: 'SCORE_NUM', header: "单件积分", width: 70 },
            { id: 'VIEW_NUM', header: "浏览次数", width: 70 },
            { id: 'LOGISTICS_TEMPLATE_NME', header: "运费模版", width: 100 },
            { id: 'COMM_BRAND_DESC', header: "品牌名称", width: 80 },
            { id: 'GOODS_STATUS_TXT', header: "商品状态", width: 60 },
            { id: 'IS_NEW', header: "新品", width: 40 },
            { id: 'IS_RECOMMEND', header: "推荐", width: 40 },
            { id: 'INITIAL_DT', header: "发布时间", width: 75 }
            ];
            var gridOption1 = getGtOp('myGrid1', colsOption, 'gridbox1', 'GOODS_ID');
            gridOption1.height = "1000px";
            gridOption1.toolbarContent = 'nav goto | pagesize | filter | state';
            gridOption1.autoLoad = true;
            gridOption1.autogtResize = false;
            var myGrid1 = new Sigma.Grid(gridOption1);
            myGrid1.render();
            myGrid1.readOnly = true;
            //            btnDo("btnEdit");
            //            autogtResize("bigbox2", myGrid1);
        };

        function btnDo(sEbtn) {
            GtGrid1Action = sEbtn;
            var opart = GetGtParam("myGrid1");
            if (sEbtn == "mFinder") {
                doFinderGt('myGrid1');
            }
            else if (sEbtn == "btnConfirm" || sEbtn == "btnCancel" || sEbtn == "btnRecommend" || sEbtn == "btnCnlRecommend" || sEbtn == "btnDelete" || sEbtn == "btnSetScore") {
                var sidtem1 = GetGtSelectId('myGrid1');
                if (sidtem1) {
                    opart.AddCell("CHECK_ID", sidtem1);
                    ajaxComm(opart, null, null, 'divCondition'); //调用页面回调，并传入参数
                } else {
                    alert("请先选择记录！");
                }
            } 
            else if (sEbtn == "dobtnSetScore") {
                var sidtem1 = GetGtSelectId('myGrid1');
                if (sidtem1) {
                    opart.AddCell("CHECK_ID", sidtem1);
                    opart.AddCell("txtSetScoreQty", $("#txtSetScoreQty").val());
                    ajaxComm(opart, null, null, 'divCondition'); //调用页面回调，并传入参数
                } else {
                    alert("请先选择记录！");
                }
            }
            else {
                ajaxComm(opart); //调用页面回调，并传入参数
            }
            GtGrid1Action = "";
        };
        function GetGtParam(jqGridID) {
            var _jsParam = new jsonRow();
            if (jqGridID == "myGrid1") {
                GetFormJson("divCondition", _jsParam);
                _jsParam.AddCell("gtGridID", "myGrid1");
                _jsParam.AddCell("ACTION", GtGrid1Action);
                //这里可增加传入后台的参数
            } return _jsParam;
        };
        var layerform;
        function ShowForm() { 
            layerform && layer.close(layerform);
            layerform = $.layer({
                type: 1,
                shade: [0],
                fix: true,
                title: '输入设置积分的数量',
                maxmin: false,
                page: { dom: '#ScoreSetBox' },
                area: ['480px', '280px']
            });
        };
    </script>
</head>
<body>
    <div id="mallPage" class="tms-page mallAct tmall-  page-not-market">
        <!-- -->
        <!--商城通用顶通-->
        <%=new msBsc.WebUi.Code.QtHtmlGet().GetHeaderTopHtml()%>
        <%=new msBsc.WebUi.Code.QtHtmlGet().GetHeaderLogoDealerHtml("商户管理")%>
        <div id="content" class="content" style=" padding-top: 10px;">
            <div class="page lang-zh-S">
                <div id="mytaobao-panel" class="grid-c2">
                    <div class="col-main" id="J_Col_Main" style="padding-bottom: 0;">
                        <div class="main-wrap">
                            <div id="main-content">
                                <div id="fragment1">
                                
                                <h2 class="h2-single">
                                    <span class="entity" id="J_DeliverTitle">查询条件</span></h2> 
            <div id="divCondition" style="margin: 3px; border-style: solid; border-width: 0px;
                border-color: #C8D2E0; background-color:#fff; padding:3px; font-size:14px;">
                <table border="0" cellpadding="0" cellspacing="0" style="float:right; line-height:35px;"> 
                    <tr>
                        <td width="70px" align="right" style=" padding-right:5px;">
                            商品名称 </td>
                        <td align="right" width="100px">
                            <input class="" id="txtGOODS_NME" type="text" value="" style="width:100px;height:24px;"/>
                        </td>
                                                <td   width="70px" align="right" style=" padding-right:5px;">
                                                    商品状态
                                                </td>
                                                <td align="right" width="100px" style=" padding-top:3px;">
                                                    <select name="dplGOODS_STATUS_SID" id="dplGOODS_STATUS_SID" style="width: 100px; line-height:28px; font-size:19px;">
                                                        <option value="" selected="selected">全部</option>
                                                        <option value="0">已下架</option>
                                                        <option value="1">销售中</option>
                                                        <option value="9">已删除</option>
                                                    </select>
                                                </td>
                        <td align="center" style=" padding-left:8px;">
                                                    <input type="button" class="btn btn-mini btn-danger" onclick="javascript:btnDo('mFinder');return false;" value="查询"
                                                        id="btnFinder" accesskey="F" />
                                                    <input type="button" class="btn btn-mini btn-danger" onclick="javascript:btnDo('btnConfirm');return false;" value="批量上架"
                                                        id="btnConfirm" />
                                                    <input type="button" class="btn btn-mini btn-danger" onclick="javascript:btnDo('btnCancel');return false;" value="批量下架"
                                                        id="btnCancel"  />
                                                    <input type="button" class="btn btn-mini btn-danger" onclick="javascript:btnDo('btnRecommend');return false;" value="掌柜推荐"
                                                        id="btnRecommend"  />
                                                    <input type="button" class="btn btn-mini btn-danger" onclick="javascript:btnDo('btnCnlRecommend');return false;" value="取消推荐"
                                                        id="btnCnlRecommend"  />
                                                    <input type="button" class="btn btn-mini btn-danger" onclick="javascript:btnDo('btnDelete');return false;" value="删除"
                                                        id="btnDelete"  />
                                                    <input type="button" class="btn btn-mini btn-danger" onclick="javascript:btnDo('btnSetScore');return false;" value="设置积分"
                                                        id="Button3"  />
                                </td>
                    </tr> 
                </table>
                <div style="clear:both;"></div>
            </div>


<%--
                                    <div id="divCondition" style="margin: 0px; border-style: solid; border-width: 1px;
                                        padding: 5px; border-color: #C8D2E0;">
                                        <table border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td class="label" width="100px;" align="right">
                                                    商品名称
                                                </td>
                                                <td align="right" width="100px">
                                                    <input name="txtGOODS_NME" type="text" id="txtGOODS_NME" style="width: 100px;" />
                                                </td>
                                                <td class="label" width="100px" align="right">
                                                    商品状态
                                                </td>
                                                <td align="right" width="100px">
                                                    <select name="dplGOODS_STATUS_SID" id="dplGOODS_STATUS_SID" style="width: 90px;">
                                                        <option value="" selected="selected"></option>
                                                        <option value="0">已下架</option>
                                                        <option value="1">销售中</option>
                                                    </select>
                                                </td>
                                                <td align="right">
                                                    <input type="button" onclick="javascript:btnDo('mFinder');return false;" value="查询(F)"
                                                        id="btnFinder" accesskey="F" />
                                                    <input type="button" onclick="javascript:btnDo('btnConfirm');return false;" value="批量上架(C)"
                                                        id="btnConfirm" accesskey="C" />
                                                    <input type="button" onclick="javascript:btnDo('btnCancel');return false;" value="批量下架(L)"
                                                        id="btnCancel" accesskey="L" />
                                                    <input type="button" onclick="javascript:btnDo('btnRecommend');return false;" value="掌柜推荐"
                                                        id="btnRecommend"  />
                                                    <input type="button" onclick="javascript:btnDo('btnCnlRecommend');return false;" value="取消推荐"
                                                        id="btnCnlRecommend"  />
                                                    <input type="button" onclick="javascript:btnDo('btnDelete');return false;" value="批量删除"
                                                        id="btnDelete"  />
                                                </td>
                                                <td>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>--%>
                                    
                                <h2 class="h2-single">
                                    <span class="entity" id="Span1">商品列表</span></h2> 
                                    <div id="bigbox1" style="margin: 0px; margin-top: 2px;">
                                        <div id="gridbox1" style="border: 0px solid #cccccc; background-color: #f3f3f3; padding: 5px;
                                            margin-left: -1px;">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- end col-main -->
                    <div class="col-sub" id="J_Col_Sub">
                        <%=new msBsc.WebUi.Code.QtHtmlGet().GetDealerMenu()%>
                    </div>
                    <div style="clear:both;"></div>
                </div>
                <!-- end mytaobao-panel -->
            </div>
        </div>
                    <div style=" clear:both; height:15px;"></div>

        <div id="ScoreSetBox" style="width: auto; display: none;padding:30px; ">
            <table border="0" cellpadding="0" cellspacing="0" style="float: right; line-height: 35px; font-size:18px;">
                <tr>
                    <td width="150px" align="right" style="padding-right: 5px;">
                        输入积分数量:
                    </td>
                    <td align="right" width="200px">
                        <input class="" id="txtSetScoreQty" type="text" value="" style="width: 200px; height: 24px;" />
                    </td>
                    <td align="center" style="padding-left: 8px;">
                    </td>
                </tr>
                <tr>
                    <td width="150px" align="right" style="padding-right: 5px;">
                        选择商品库存:
                    </td>
                    <td align="left" width="100px">
                        <span id="spnSelGoodsQty" style="color: #c40000; font-size: 18px;"></span>
                    </td>
                    <td align="center" style="padding-left: 8px;">
                    </td>
                </tr>
                <tr>
                    <td width="150px" align="right" style="padding-right: 5px;">
                        可用积分数量:
                    </td>
                    <td align="left" width="100px">
                        <span id="spnAllowUseScoreQty" style="color: #c40000; font-size: 18px;"></span>
                    </td>
                    <td align="center" style="padding-left: 8px;">
                    </td>
                </tr>
            </table>
            <div>
                <center>
                    <input type="button" class="btn btn-mini btn-danger" onclick="javascript:btnDo('dobtnSetScore');return false;"
                        value="确定" id="dobtnSetScore"  />
                </center>
            </div>
            <input id="txtORDER_LIST_ID" type="text" value="" style="display: none;" />
        </div>
        <%=new msBsc.WebUi.Code.QtHtmlGet().GetFloorHtml()%>
    </div>
    <!-- foot script -->
</body>
</html>
